export const state = () => ({
    draftsList: []
})

export const mutations = {
    addDrafts(state, data) {
        state.draftsList.unshift(data)
        if (state.draftsList.length > 5) {
            state.draftsList.pop()
        }
    },
    del(state, id) {
        state.draftsList.map((v, i) => {
            if (i == id) {
                state.draftsList.splice(i, 1)
            }
        })
    }
}
